Optimal. Leaf size=269 \[ -\frac {1}{32} \log \left (x^2-x+1\right ) (9 d-4 f+3 h)+\frac {1}{32} \log \left (x^2+x+1\right ) (9 d-4 f+3 h)+\frac {x \left (-\left (x^2 (7 d-7 f+4 h)\right )+2 d+3 f-h\right )}{24 \left (x^4+x^2+1\right )}+\frac {x \left (-\left (x^2 (d-2 f+h)\right )+d+f-2 h\right )}{12 \left (x^4+x^2+1\right )^2}-\frac {\tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right ) (13 d+2 f+h)}{48 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) (13 d+2 f+h)}{48 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {2 x^2+1}{\sqrt {3}}\right ) (2 e-g+i)}{3 \sqrt {3}}+\frac {\left (2 x^2+1\right ) (2 e-g+i)}{12 \left (x^4+x^2+1\right )}+\frac {x^2 (2 e-g-i)+e-2 g+i}{12 \left (x^4+x^2+1\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 269, normalized size of antiderivative = 1.00, number of steps used = 18, number of rules used = 12, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {1673, 1678, 1178, 1169, 634, 618, 204, 628, 1663, 1660, 12, 614} \[ \frac {x \left (x^2 (-(7 d-7 f+4 h))+2 d+3 f-h\right )}{24 \left (x^4+x^2+1\right )}+\frac {x \left (x^2 (-(d-2 f+h))+d+f-2 h\right )}{12 \left (x^4+x^2+1\right )^2}-\frac {1}{32} \log \left (x^2-x+1\right ) (9 d-4 f+3 h)+\frac {1}{32} \log \left (x^2+x+1\right ) (9 d-4 f+3 h)-\frac {\tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right ) (13 d+2 f+h)}{48 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) (13 d+2 f+h)}{48 \sqrt {3}}+\frac {\left (2 x^2+1\right ) (2 e-g+i)}{12 \left (x^4+x^2+1\right )}+\frac {x^2 (2 e-g-i)+e-2 g+i}{12 \left (x^4+x^2+1\right )^2}+\frac {\tan ^{-1}\left (\frac {2 x^2+1}{\sqrt {3}}\right ) (2 e-g+i)}{3 \sqrt {3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 204
Rule 614
Rule 618
Rule 628
Rule 634
Rule 1169
Rule 1178
Rule 1660
Rule 1663
Rule 1673
Rule 1678
Rubi steps
\begin {align*} \int \frac {d+e x+f x^2+g x^3+h x^4+51 x^5}{\left (1+x^2+x^4\right )^3} \, dx &=\int \frac {x \left (e+g x^2+51 x^4\right )}{\left (1+x^2+x^4\right )^3} \, dx+\int \frac {d+f x^2+h x^4}{\left (1+x^2+x^4\right )^3} \, dx\\ &=\frac {x \left (d+f-2 h-(d-2 f+h) x^2\right )}{12 \left (1+x^2+x^4\right )^2}+\frac {1}{12} \int \frac {11 d-f+2 h-5 (d-2 f+h) x^2}{\left (1+x^2+x^4\right )^2} \, dx+\frac {1}{2} \operatorname {Subst}\left (\int \frac {e+g x+51 x^2}{\left (1+x+x^2\right )^3} \, dx,x,x^2\right )\\ &=\frac {51+e-2 g-(51-2 e+g) x^2}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (d+f-2 h-(d-2 f+h) x^2\right )}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (2 d+3 f-h-(7 d-7 f+4 h) x^2\right )}{24 \left (1+x^2+x^4\right )}+\frac {1}{72} \int \frac {15 (4 d-f+h)-3 (7 d-7 f+4 h) x^2}{1+x^2+x^4} \, dx+\frac {1}{12} \operatorname {Subst}\left (\int \frac {3 (51+2 e-g)}{\left (1+x+x^2\right )^2} \, dx,x,x^2\right )\\ &=\frac {51+e-2 g-(51-2 e+g) x^2}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (d+f-2 h-(d-2 f+h) x^2\right )}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (2 d+3 f-h-(7 d-7 f+4 h) x^2\right )}{24 \left (1+x^2+x^4\right )}+\frac {1}{144} \int \frac {15 (4 d-f+h)-(15 (4 d-f+h)+3 (7 d-7 f+4 h)) x}{1-x+x^2} \, dx+\frac {1}{144} \int \frac {15 (4 d-f+h)+(15 (4 d-f+h)+3 (7 d-7 f+4 h)) x}{1+x+x^2} \, dx+\frac {1}{4} (51+2 e-g) \operatorname {Subst}\left (\int \frac {1}{\left (1+x+x^2\right )^2} \, dx,x,x^2\right )\\ &=\frac {51+e-2 g-(51-2 e+g) x^2}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (d+f-2 h-(d-2 f+h) x^2\right )}{12 \left (1+x^2+x^4\right )^2}+\frac {(51+2 e-g) \left (1+2 x^2\right )}{12 \left (1+x^2+x^4\right )}+\frac {x \left (2 d+3 f-h-(7 d-7 f+4 h) x^2\right )}{24 \left (1+x^2+x^4\right )}+\frac {1}{6} (51+2 e-g) \operatorname {Subst}\left (\int \frac {1}{1+x+x^2} \, dx,x,x^2\right )+\frac {1}{32} (-9 d+4 f-3 h) \int \frac {-1+2 x}{1-x+x^2} \, dx+\frac {1}{96} (13 d+2 f+h) \int \frac {1}{1-x+x^2} \, dx+\frac {1}{96} (13 d+2 f+h) \int \frac {1}{1+x+x^2} \, dx+\frac {1}{32} (9 d-4 f+3 h) \int \frac {1+2 x}{1+x+x^2} \, dx\\ &=\frac {51+e-2 g-(51-2 e+g) x^2}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (d+f-2 h-(d-2 f+h) x^2\right )}{12 \left (1+x^2+x^4\right )^2}+\frac {(51+2 e-g) \left (1+2 x^2\right )}{12 \left (1+x^2+x^4\right )}+\frac {x \left (2 d+3 f-h-(7 d-7 f+4 h) x^2\right )}{24 \left (1+x^2+x^4\right )}-\frac {1}{32} (9 d-4 f+3 h) \log \left (1-x+x^2\right )+\frac {1}{32} (9 d-4 f+3 h) \log \left (1+x+x^2\right )+\frac {1}{3} (-51-2 e+g) \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x^2\right )+\frac {1}{48} (-13 d-2 f-h) \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x\right )+\frac {1}{48} (-13 d-2 f-h) \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x\right )\\ &=\frac {51+e-2 g-(51-2 e+g) x^2}{12 \left (1+x^2+x^4\right )^2}+\frac {x \left (d+f-2 h-(d-2 f+h) x^2\right )}{12 \left (1+x^2+x^4\right )^2}+\frac {(51+2 e-g) \left (1+2 x^2\right )}{12 \left (1+x^2+x^4\right )}+\frac {x \left (2 d+3 f-h-(7 d-7 f+4 h) x^2\right )}{24 \left (1+x^2+x^4\right )}-\frac {(13 d+2 f+h) \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{48 \sqrt {3}}+\frac {(13 d+2 f+h) \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )}{48 \sqrt {3}}+\frac {(51+2 e-g) \tan ^{-1}\left (\frac {1+2 x^2}{\sqrt {3}}\right )}{3 \sqrt {3}}-\frac {1}{32} (9 d-4 f+3 h) \log \left (1-x+x^2\right )+\frac {1}{32} (9 d-4 f+3 h) \log \left (1+x+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.98, size = 325, normalized size = 1.21 \[ \frac {1}{144} \left (\frac {12 \left (-d x^3+d x+2 e x^2+e+2 f x^3+f x-g \left (x^2+2\right )-h x^3-2 h x-i x^2+i\right )}{\left (x^4+x^2+1\right )^2}+\frac {6 \left (-7 d x^3+2 d x+e \left (8 x^2+4\right )+7 f x^3+3 f x-2 g \left (2 x^2+1\right )-4 h x^3-h x+4 i x^2+2 i\right )}{x^4+x^2+1}-\frac {\tan ^{-1}\left (\frac {1}{2} \left (\sqrt {3}-i\right ) x\right ) \left (\left (7 \sqrt {3}-47 i\right ) d+\left (-7 \sqrt {3}+17 i\right ) f+2 \left (2 \sqrt {3}-7 i\right ) h\right )}{\sqrt {\frac {1}{6} \left (1+i \sqrt {3}\right )}}-\frac {\tan ^{-1}\left (\frac {1}{2} \left (\sqrt {3}+i\right ) x\right ) \left (\left (7 \sqrt {3}+47 i\right ) d-\left (7 \sqrt {3}+17 i\right ) f+2 \left (2 \sqrt {3}+7 i\right ) h\right )}{\sqrt {\frac {1}{6} \left (1-i \sqrt {3}\right )}}-16 \sqrt {3} \tan ^{-1}\left (\frac {\sqrt {3}}{2 x^2+1}\right ) (2 e-g+i)\right ) \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 23.87, size = 521, normalized size = 1.94 \[ -\frac {12 \, {\left (7 \, d - 7 \, f + 4 \, h\right )} x^{7} - 48 \, {\left (2 \, e - g + i\right )} x^{6} + 60 \, {\left (d - 2 \, f + h\right )} x^{5} - 72 \, {\left (2 \, e - g + i\right )} x^{4} + 84 \, {\left (d - 2 \, f + h\right )} x^{3} - 48 \, {\left (4 \, e - 2 \, g + i\right )} x^{2} - 2 \, \sqrt {3} {\left ({\left (13 \, d - 32 \, e + 2 \, f + 16 \, g + h - 16 \, i\right )} x^{8} + 2 \, {\left (13 \, d - 32 \, e + 2 \, f + 16 \, g + h - 16 \, i\right )} x^{6} + 3 \, {\left (13 \, d - 32 \, e + 2 \, f + 16 \, g + h - 16 \, i\right )} x^{4} + 2 \, {\left (13 \, d - 32 \, e + 2 \, f + 16 \, g + h - 16 \, i\right )} x^{2} + 13 \, d - 32 \, e + 2 \, f + 16 \, g + h - 16 \, i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) - 2 \, \sqrt {3} {\left ({\left (13 \, d + 32 \, e + 2 \, f - 16 \, g + h + 16 \, i\right )} x^{8} + 2 \, {\left (13 \, d + 32 \, e + 2 \, f - 16 \, g + h + 16 \, i\right )} x^{6} + 3 \, {\left (13 \, d + 32 \, e + 2 \, f - 16 \, g + h + 16 \, i\right )} x^{4} + 2 \, {\left (13 \, d + 32 \, e + 2 \, f - 16 \, g + h + 16 \, i\right )} x^{2} + 13 \, d + 32 \, e + 2 \, f - 16 \, g + h + 16 \, i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - 12 \, {\left (4 \, d + 5 \, f - 5 \, h\right )} x - 9 \, {\left ({\left (9 \, d - 4 \, f + 3 \, h\right )} x^{8} + 2 \, {\left (9 \, d - 4 \, f + 3 \, h\right )} x^{6} + 3 \, {\left (9 \, d - 4 \, f + 3 \, h\right )} x^{4} + 2 \, {\left (9 \, d - 4 \, f + 3 \, h\right )} x^{2} + 9 \, d - 4 \, f + 3 \, h\right )} \log \left (x^{2} + x + 1\right ) + 9 \, {\left ({\left (9 \, d - 4 \, f + 3 \, h\right )} x^{8} + 2 \, {\left (9 \, d - 4 \, f + 3 \, h\right )} x^{6} + 3 \, {\left (9 \, d - 4 \, f + 3 \, h\right )} x^{4} + 2 \, {\left (9 \, d - 4 \, f + 3 \, h\right )} x^{2} + 9 \, d - 4 \, f + 3 \, h\right )} \log \left (x^{2} - x + 1\right ) - 72 \, e + 72 \, g - 48 \, i}{288 \, {\left (x^{8} + 2 \, x^{6} + 3 \, x^{4} + 2 \, x^{2} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.37, size = 255, normalized size = 0.95 \[ \frac {1}{144} \, \sqrt {3} {\left (13 \, d + 2 \, f + 16 \, g + h - 16 \, i - 32 \, e\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{144} \, \sqrt {3} {\left (13 \, d + 2 \, f - 16 \, g + h + 16 \, i + 32 \, e\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + \frac {1}{32} \, {\left (9 \, d - 4 \, f + 3 \, h\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{32} \, {\left (9 \, d - 4 \, f + 3 \, h\right )} \log \left (x^{2} - x + 1\right ) - \frac {7 \, d x^{7} - 7 \, f x^{7} + 4 \, h x^{7} + 4 \, g x^{6} - 4 \, i x^{6} - 8 \, x^{6} e + 5 \, d x^{5} - 10 \, f x^{5} + 5 \, h x^{5} + 6 \, g x^{4} - 6 \, i x^{4} - 12 \, x^{4} e + 7 \, d x^{3} - 14 \, f x^{3} + 7 \, h x^{3} + 8 \, g x^{2} - 4 \, i x^{2} - 16 \, x^{2} e - 4 \, d x - 5 \, f x + 5 \, h x + 6 \, g - 4 \, i - 6 \, e}{24 \, {\left (x^{4} + x^{2} + 1\right )}^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 454, normalized size = 1.69 \[ \frac {13 \sqrt {3}\, d \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{144}+\frac {13 \sqrt {3}\, d \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{144}-\frac {9 d \ln \left (x^{2}-x +1\right )}{32}+\frac {9 d \ln \left (x^{2}+x +1\right )}{32}-\frac {2 \sqrt {3}\, e \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{9}+\frac {2 \sqrt {3}\, e \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{9}+\frac {\sqrt {3}\, f \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{72}+\frac {\sqrt {3}\, f \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{72}+\frac {f \ln \left (x^{2}-x +1\right )}{8}-\frac {f \ln \left (x^{2}+x +1\right )}{8}+\frac {\sqrt {3}\, g \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{9}-\frac {\sqrt {3}\, g \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{9}+\frac {\sqrt {3}\, h \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{144}+\frac {\sqrt {3}\, h \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{144}-\frac {3 h \ln \left (x^{2}-x +1\right )}{32}+\frac {3 h \ln \left (x^{2}+x +1\right )}{32}-\frac {\sqrt {3}\, i \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{9}+\frac {\sqrt {3}\, i \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{9}+\frac {\left (-\frac {7 d}{3}-\frac {4 e}{3}+\frac {7 f}{3}-\frac {g}{3}-\frac {4 h}{3}+\frac {i}{3}\right ) x^{3}+\left (-6 d +4 f -2 g -2 h +2 i \right ) x^{2}-4 d +2 e +\frac {4 f}{3}-2 g +\frac {4 i}{3}+\left (-\frac {20 d}{3}+\frac {e}{3}+\frac {13 f}{3}-\frac {8 g}{3}-\frac {5 h}{3}+\frac {7 i}{3}\right ) x}{16 \left (x^{2}+x +1\right )^{2}}-\frac {\left (\frac {7 d}{3}-\frac {4 e}{3}-\frac {7 f}{3}-\frac {g}{3}+\frac {4 h}{3}+\frac {i}{3}\right ) x^{3}+\left (-6 d +4 f +2 g -2 h -2 i \right ) x^{2}-4 d -2 e +\frac {4 f}{3}+2 g -\frac {4 i}{3}+\left (\frac {20 d}{3}+\frac {e}{3}-\frac {13 f}{3}-\frac {8 g}{3}+\frac {5 h}{3}+\frac {7 i}{3}\right ) x}{16 \left (x^{2}-x +1\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 2.12, size = 229, normalized size = 0.85 \[ \frac {1}{144} \, \sqrt {3} {\left (13 \, d - 32 \, e + 2 \, f + 16 \, g + h - 16 \, i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{144} \, \sqrt {3} {\left (13 \, d + 32 \, e + 2 \, f - 16 \, g + h + 16 \, i\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + \frac {1}{32} \, {\left (9 \, d - 4 \, f + 3 \, h\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{32} \, {\left (9 \, d - 4 \, f + 3 \, h\right )} \log \left (x^{2} - x + 1\right ) - \frac {{\left (7 \, d - 7 \, f + 4 \, h\right )} x^{7} - 4 \, {\left (2 \, e - g + i\right )} x^{6} + 5 \, {\left (d - 2 \, f + h\right )} x^{5} - 6 \, {\left (2 \, e - g + i\right )} x^{4} + 7 \, {\left (d - 2 \, f + h\right )} x^{3} - 4 \, {\left (4 \, e - 2 \, g + i\right )} x^{2} - {\left (4 \, d + 5 \, f - 5 \, h\right )} x - 6 \, e + 6 \, g - 4 \, i}{24 \, {\left (x^{8} + 2 \, x^{6} + 3 \, x^{4} + 2 \, x^{2} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.22, size = 1963, normalized size = 7.30 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________